from django.db import models


class Area(models.Model):
    areaid  = models.IntegerField(primary_key=True)
    areaname = models.CharField(max_length=50)
    parentid = models.IntegerField()
    arealevel = models.IntegerField()
    status = models.IntegerField()

    class Meta:
        managed = False #False不会在生成表
        db_table = 'area'


class User(models.Model):
    head = models.ImageField(upload_to='static/userhead/',verbose_name='头像')
    name = models.CharField(max_length=20,verbose_name='昵称')
    password = models.CharField(max_length=100,verbose_name='密码')
    email = models.EmailField(verbose_name='邮箱')
    gender = models.CharField(max_length=32, default='男',verbose_name='性别')
    age = models.CharField(max_length=10,verbose_name='年龄')
    aname = models.CharField(max_length=30,verbose_name='名字')   #姓名
    aphone = models.CharField(max_length=30,verbose_name='手机号')
    addr = models.CharField(max_length=30,verbose_name='地址')

    class Meta:
        verbose_name_plural='用户'
        managed = False  # False不会在生成表

    def Gethead(self):
        return

